package com.mix.service;


import com.mix.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class RestfulTestImpl implements RestfulTest {

    @Autowired
    RedisUtil redisUtil;

    @Autowired
    RedisTemplate redisTemplate;

    @Override
    public String setRedisTest(String key, String val) {
//        redisTemplate.opsForValue().set(key, val);
//        RedisUtil.set(key, val);
        redisUtil.set(key, val);
        return "success";
    }

    @Override
    public String getRedisTest(String key) {
        String s = (String) redisTemplate.opsForValue().get(key);
        return s;
    }


}
